package com.horse.pack.controller;

import cn.hutool.http.HttpUtil;
import com.horse.pack.common.GeneralResponse;
import com.horse.pack.common.constant.HttpConstant;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author yangliu
 * @date 2024/3/25 5:53 PM
 */
@RestController
@RequestMapping("/base")
public class KfcBaseController {

    @GetMapping("/getCitys")
    public GeneralResponse getCitys() {

        Map<String,Object> paramMap = new HashMap<>();
        paramMap.put("type",1);
        String res = HttpUtil.get(HttpConstant.ORI_TEST_URL + HttpConstant.GET_CITYS_API,paramMap);
        return GeneralResponse.success();
    }

    @GetMapping("/map/getCity")
    public GeneralResponse getCity() {
        Map<String,Object> paramMap = new HashMap<>();
        paramMap.put("latitude",31.25956);
        paramMap.put("longitude",121.52609);
        String res = HttpUtil.get(HttpConstant.ORI_TEST_URL + HttpConstant.MAP_GET_CITY_API,paramMap);
        return GeneralResponse.success();
    }
}
